<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 *
 *
 *
 * @package     h
 * @subpackage  models
 * @category    models
 * @author      hyw
 * @copyright   copyright (c) 2012
 * @filesource
 */
class Address_city_model extends Base_model {
    protected $_table_name = 'address_city';
    protected $_key_name = 'id';
	
    function get_all() {
		return $this->fetch(NULL, NULL);
    }
	
	function get_all_new() {
		
		$sql="SELECT * FROM `h_address_city` WHERE `dtime` ='0' ";
		
        $r=$this->db->query($sql);
		
        return $r->result();
    }
	
	
	
	function get_address_city() {
		$where=array('dtime'=>0);
		$result=$this->fetch(NULL, $where);
		$p=array();
		foreach($result as $key=>$val){
			$p[$val->id]=$val->name;
		}
		return $p;
    }
}